home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / esc.jar / com / extensibility / xa / undo / NotationPublicUndoable.class (.txt) < prev    next >
Encoding:
Java Class File  |  2000-06-30  |  1.8 KB  |  50 lines

  1. package com.extensibility.xa.undo;
  2.  
  3. import com.extensibility.app.UI;
  4. import com.extensibility.xa.NotationModel;
  5. import com.extensibility.xa.XADesktop;
  6. import com.extensibility.xml.BaseDeclaration;
  7. import com.extensibility.xml.NotationDeclaration;
  8.  
  9. public class NotationPublicUndoable extends DeclTableUndoable {
  10.    NotationDeclaration notationDecl;
  11.  
  12.    public NotationPublicUndoable(NotationModel var1, BaseDeclaration var2, Object var3) {
  13.       super(XADesktop.getTableForModel(var1), var2, var3);
  14.       this.notationDecl = (NotationDeclaration)var2;
  15.       super.oldValue = ((NotationModel)super.tableModel).getValueAt(super.tableModel.getRowForDecl(this.notationDecl), 4);
  16.    }
  17.  
  18.    public String getPresentationName() {
  19.       return UI.getString("undo.notations.pub");
  20.    }
  21.  
  22.    public void undo() {
  23.       super.undo();
  24.       String var1 = super.oldValue == null ? "" : (String)super.oldValue;
  25.       if (var1.length() == 0) {
  26.          this.notationDecl.setPublicID((String)null);
  27.       } else {
  28.          this.notationDecl.setPublicID(var1);
  29.       }
  30.  
  31.       ((DeclTableUndoable)this).setCellFocus(super.tableModel.getRowForDecl(this.notationDecl), 4);
  32.    }
  33.  
  34.    public void doCommand() {
  35.       String var1 = (String)super.newValue;
  36.       if (var1.length() == 0) {
  37.          this.notationDecl.setPublicID((String)null);
  38.       } else {
  39.          this.notationDecl.setPublicID(var1);
  40.       }
  41.  
  42.    }
  43.  
  44.    public void redo() {
  45.       super.redo();
  46.       this.doCommand();
  47.       ((DeclTableUndoable)this).setCellFocus(super.tableModel.getRowForDecl(this.notationDecl), 4);
  48.    }
  49. }
  50.